package com.zoke.daycarpool.parser;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.zoke.daycarpool.domain.MinePubBeen;

public class MyPublishParser extends BaseCarParser<List<MinePubBeen>> {

	@Override
	public List<MinePubBeen> parseJson(String json) throws JSONException {
		List<MinePubBeen> list = new ArrayList<MinePubBeen>();
		JSONObject jo = getJsonObject(json);
		JSONArray array = jo.getJSONArray("result");
		//
		for (int x = 0; x < array.length(); x++) {
			MinePubBeen mb = new MinePubBeen();
			JSONObject joo = array.getJSONObject(x);
			mb.setMsgId(joo.optString("msgId"));
			mb.setDesc(joo.optString("desc"));
			mb.setPubDate(joo.optString("pubDate"));
			list.add(mb);
		}
		return list;
	}

}
